<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on March 12, 2009 at 4:55:51 pm</time-stamp>


<class>
<name>LotTest</name>
<environment>SupplyChain</environment>
<super>XProgramming.SUnit.TestCase</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>i1 i2 i3 i4 i5 lot </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.LotTest class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.LotTest</class-id>
<body>LotTest has not been commented.  The comment should state the purpose of the class and also explain any unobvious aspects of the implementation.

Instance Variables:
	i1	&lt;Object&gt;	description of i1
	i2	&lt;Object&gt;	description of i2
	i3	&lt;Object&gt;	description of i3
	i4	&lt;Object&gt;	description of i4
	i5	&lt;Object&gt;	description of i5

</body>
</comment>

<methods>
<class-id>SupplyChain.LotTest</class-id> <category>accessing</category>

<body package="SupplyChain" selector="i1">i1
	^i1</body>

<body package="SupplyChain" selector="i1:">i1: anObject
	i1 := anObject.
	^self</body>

<body package="SupplyChain" selector="i2">i2
	^i2</body>

<body package="SupplyChain" selector="i2:">i2: anObject
	i2 := anObject.
	^self</body>

<body package="SupplyChain" selector="i3">i3
	^i3</body>

<body package="SupplyChain" selector="i3:">i3: anObject
	i3 := anObject.
	^self</body>

<body package="SupplyChain" selector="i4">i4
	^i4</body>

<body package="SupplyChain" selector="i4:">i4: anObject
	i4 := anObject.
	^self</body>

<body package="SupplyChain" selector="i5">i5
	^i5</body>

<body package="SupplyChain" selector="i5:">i5: anItem
	i5 := anItem.
	^self</body>

<body package="SupplyChain" selector="lot">lot
	^lot</body>

<body package="SupplyChain" selector="lot:">lot: aLot
	lot := aLot.
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.LotTest</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	i1 := nil.
	i2 := nil.
	i3 := nil.
	i4 := nil.
	i5 := nil.
	lot := nil.
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.LotTest</class-id> <category>Running</category>

<body package="SupplyChain" selector="setUp">setUp
	"Creates the test objects"
	lot := Lot new.
	i1 := Item named: 'Video Game' sku:'89X999'.
	i2 := Item named: 'TV' sku: '99Z837'.
	i3 := Item named: 'VCR' sku: '54Y3632'.
	i4 := Item named: 'PC' sku: '01P6373'.
	i5 := Item named: 'Laptop' sku: '11F4732'.</body>

<body package="SupplyChain" selector="testAddItems">testAddItems
	"Tests the addItem functionality"
	
	self assert: lot size = 0.
	lot addItem: i1.
	self assert: lot size = 1.
	lot addItem: i2.
	self assert: lot size = 2.
	self deny: (lot contains: i3).
	lot addItem: i3.
	self assert: (lot contains: i3).
	self assert: lot size = 3.</body>

<body package="SupplyChain" selector="testNumber">testNumber
	| rval |
	rval := (Random new) nextInt: 1000000.
	lot number: rval.
	self assert: (lot number = rval)</body>
</methods>

</st-source>
